import jieba
from wordcloud import WordCloud
import matplotlib.pyplot as plt
str='王老师饿了一天没吃东西，看到其他老师桌子上有苹果，以帮人洗苹果为由，吃别人的苹果'
s=jieba.lcut(str)
s=[i for i in s if len(i)>1 ]
s=' '.join(s)
print(s)
wc=WordCloud(background_color='white').generate(s)
plt.imshow(wc)
plt.axis('off')
plt.show()